<div class="content__title">
    <h1>
        资源管理
    </h1>
</div>
<nz-table #nzTable [nzDataSource]="data" [nzScroll]="{ y: 800 }" [nzBordered]="true" [nzSize]="'middle'" [nzIsPagination]="false">
    <thead nz-thead>
    <tr>
        <th nz-th>名称</th>
        <th nz-th>编码</th>
        <th nz-th>类型</th>
        <th nz-th>图标</th>
        <th nz-th>url</th>
        <th nz-th>method</th>
        <th nz-th>排序</th>
        <th nz-th>状态</th>
        <th nz-th>备注</th>
        <th nz-th>操作
            <span *ngIf="acl.canAbility('25')">
            <span nz-table-divider></span>
            <a (click)="edit({id:0})">添加</a>
        </span>
        </th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data">
        <ng-template ngFor let-item [ngForOf]="expandDataCache[data.id]">
            <tr nz-tbody-tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
                <td nz-td>
                    <nz-row-indent [nzIndentSize]="item.level"></nz-row-indent>
                    <nz-row-expand-icon [(nzExpand)]="item.expand" (nzExpandChange)="collapse(expandDataCache[data.id],item,$event)" [nzShowExpand]="!item.children"></nz-row-expand-icon>
                    {{item.name}}
                </td>
                <td nz-td>{{item.id}}</td>
                <td nz-td>
                    <span *ngIf="item.ismenu"><i class="icon-menu"></i></span>
                </td>
                <td nz-td><i [class]="item.icon"></i></td>
                <td nz-td>{{item.url}}</td>
                <td nz-td>{{item.method}}</td>
                <td nz-td>{{item.sort}}</td>
                <td nz-td>
                    <nz-tag *ngIf="item.enable" [nzColor]="'green'">activate</nz-tag>
                    <nz-tag *ngIf="!item.enable" nzColor="orange">disable</nz-tag>
                </td>
                <td nz-td>{{item.remark}}</td>
                <td nz-td>
                    <a *ngIf="acl.canAbility('25')" (click)="edit(item)">编辑</a>
                    <span *ngIf="acl.canAbility('26')">
                        <span nz-table-divider></span>
                        <nz-popconfirm [nzTitle]="'确定删除？'" [nzOkText]="'ok'" [nzCancelText]="'cancel'" (nzOnConfirm)="del(item.id)">
                            <a nz-popconfirm>删除</a>
                        </nz-popconfirm>
                    </span>
                </td>
            </tr>
        </ng-template>
    </ng-template>
    </tbody>
</nz-table>
